<?php

		defined('BY_JYA') or exit('error');
//		list($cardid)=$arguments;
		$item=$this->plugin_setting('setting');
		if(!$item['appkey'] || !$item['secret']){
			exi('参数错误,请联系管理员','error','/list/');
		}
		$data=array('appKey'=>$item['appkey'],'appSecret'=>$item['secret']);
		$url = 'https://open.ys7.com/api/lapp/token/get';
		$result = cfc('http')->ihttp_post($url, $data);
		$result =@json_decode($result['content'],true);
		
		if($result['code']!='200'){
			exi('token获取失败:'.$result['msg'],'error');
		}else{
			return $result['data']['accessToken'];	
		}
		
